Easy Scalping Lot Calculator for ForexThe calculator was created to make it easier to calculate the lot size on Forex. I planned to use it for the following pairs: AUDCAD, AUDCHF, AUDJPY, AUDUSD, EURAUD, EURCAD, EURCHF, EURGBP, EURJPY, EURNZD, EURUSD, GBPCHF, GBPJPY, GBPUSD, NZDUSD, USDCAD, USDCHF, USDJPY, XAUUSD. 
The indicator is a table that shows the calculation of the lot for a predetermined stop loss.
For example, you are planning a trade, have calculated a stop loss of 15 points, and by checking the table you understand approximately what lot you need to use to limit your risk.
In the settings you can change the risk and also determine the stop loss value in points.
The calculator does not take into account the spread in the calculations.
There are websites where you can accurately calculate the lot, but if you trade on small time frames this is not suitable for you.
The calculator uses the formula:
Lot size = maximum risk / stop loss (in pips) / minimum pip value x minimum trading lot.
Cerca negli script per "stop loss"
ACD Indicator [TradingFinder] M Fisher Pivots Methodology Signal🔵 Introduction 
The book "The Logical Trader" begins with a comprehensive review of the ACD Methodology principles, which include identifying specific price points related to the opening range. 
This method allows you to set reference points for trading and use points "A" and "C" for trade entry. You will also learn about the "Pivot Range" and how to combine them with the ACD method to maximize position size and minimize risk. 
In this indicator, the strategy is implemented to make it easier to use.
  
🔵 How to Use 
The "ACD" strategy can be applied to various markets such as stocks, commodities, or forex, providing buy and sell signals that allow you to set your price targets and stop losses. 
This strategy is based on the assumption that the opening range of trades is statistically significant each day, meaning the initial market fluctuations influence the market until the end of the day.
The ACD trading strategy is known as a breakout strategy and performs best in volatile or strongly trending markets, such as crude oil and stocks. 
 Some of the rules for using the ACD strategy include the following :
 
 Consider points A and C as reference points and continuously pay attention to these points during trades. These points serve as entry and exit points for trades.
 Examine daily and multi-day pivot ranges to analyze market trends. If the price is above the pivots, the trend is upward, and if below the pivots, the trend is downward.
 
Trading with the ACD strategy in forex is possible using the ACD indicator. This indicator is a technical tool used to measure the balance between supply and demand in the market. By analyzing trading volume and price, this indicator helps traders identify trend strength and suitable entry and exit points. 
 To use the ACD indicator, consider the following :
 
 Identifying strong trends: The ACD indicator can help you identify strong and stable trends in the market.
 Determining entry and exit points: ACD provides buy and sell signals to enter or exit trades at the best possible time.
 
 Bullish Setup :
When the "A up" line is broken, it is advisable to wait for some time to ensure that this is not a "Fake Breakout" and that the price stabilizes above this line. 
After entering the trade, the best stop loss you can choose is below the "A down" line. However, it is recommended to test this in backtests to achieve the best results. The suitable reward-to-risk ratio for this strategy is 1, which should also be backtested.
  
 Bearish Setup :
When the "A down" line is broken, it is advisable to wait for some time to ensure that this is not a "Fake Breakout" and that the price stabilizes below this line. 
After entering the trade, the best stop loss you can choose is above the "A up" line. However, it is recommended to test this in backtests to achieve the best results. The suitable reward-to-risk ratio for this strategy is 1, which should also be backtested.
  
🔵 Setting 
 NDay Pivot Range Period : Using this entry you can specify the number of days to calculate NDay Pivot Range.
 Show Daily Pivot Range : Set the Daily Pivot color and displayed or not.
 Show NDay Pivot Range : Set the NDay Pivot color and displayed or not.
 ATR Period Levels : Determining the period of the ATR indicator, which is used to determine the A and C levels.
 Show Tokyo ACD Setup : Set the Tokyo ACD Setup color and displayed or not.
 Tokyo Opening Range Time : The amount of time taken to determine the opening range. You can set this number between 5 and 60 minutes.
 Tokyo Session : Market start and end time.
 A Level Multiplier : The coefficient that is multiplied by ATR to determine the distance of line A up and A down.
 C Level Multiplier : The coefficient that is multiplied by ATR to determine the distance of line C up and C down.
The same settings exist for the London and New York sessions.
Bitcoin Futures vs. Spot Tri-Frame - Strategy [presentTrading]Prove idea with a backtest is always true for trading.
I developed and open-sourced it as an educational material for crypto traders to understand that the futures and spot spread may be effective but not be as effective as they might think. It serves as an indicator of sentiment rather than a reliable predictor of market trends over certain periods. It is better suited for specific trading environments, which require further research.
█ Introduction and How it is Different
The "Bitcoin Futures vs. Spot Tri-Frame Strategy" utilizes three different timeframes to calculate the Z-Score of the spread between BTC futures and spot prices on Binance and OKX exchanges. The strategy executes long or short trades based on composite Z-Score conditions across the three timeframes. 
The spread refers to the difference in price between BTC futures and BTC spot prices, calculated by taking a weighted average of futures prices from multiple exchanges (Binance and OKX) and subtracting a weighted average of spot prices from the same exchanges.
BTCUSD 1D L/S Performance
  
█ Strategy, How It Works: Detailed Explanation
🔶 Calculation of the Spread
The spread is the difference in price between BTC futures and BTC spot prices. The strategy calculates the spread by taking a weighted average of futures prices from multiple exchanges (Binance and OKX) and subtracting a weighted average of spot prices from the same exchanges. This spread serves as the primary metric for identifying trading opportunities.
Spread = Weighted Average Futures Price - Weighted Average Spot Price
🔶 Z-Score Calculation
The Z-Score measures how many standard deviations the current spread is from its historical mean. This is calculated for each timeframe as follows:
Spread Mean_tf = SMA(Spread_tf, longTermSMA)
Spread StdDev_tf = STDEV(Spread_tf, longTermSMA)
Z-Score_tf = (Spread_tf - Spread Mean_tf) / Spread StdDev_tf
Local performance
  
🔶 Composite Entry Conditions
The strategy triggers long and short entries based on composite Z-Score conditions across all three timeframes:
- Long Condition: All three Z-Scores must be greater than the long entry threshold.
  Long Condition = (Z-Score_tf1 > zScoreLongEntryThreshold) and (Z-Score_tf2 > zScoreLongEntryThreshold) and (Z-Score_tf3 > zScoreLongEntryThreshold)
- Short Condition: All three Z-Scores must be less than the short entry threshold.
  Short Condition = (Z-Score_tf1 < zScoreShortEntryThreshold) and (Z-Score_tf2 < zScoreShortEntryThreshold) and (Z-Score_tf3 < zScoreShortEntryThreshold)
█ Trade Direction
The strategy allows the user to specify the trading direction:
- Long: Only long trades are executed.
- Short: Only short trades are executed.
- Both: Both long and short trades are executed based on the Z-Score conditions.
█ Usage
The strategy can be applied to BTC or Crypto trading on major exchanges like Binance and OKX. By leveraging discrepancies between futures and spot prices, traders can exploit market inefficiencies. This strategy is suitable for traders who prefer a statistical approach and want to diversify their timeframes to validate signals.
█ Default Settings
- Input TF 1 (60 minutes): Sets the first timeframe for Z-Score calculation.
- Input TF 2 (120 minutes): Sets the second timeframe for Z-Score calculation.
- Input TF 3 (180 minutes): Sets the third timeframe for Z-Score calculation.
- Long Entry Z-Score Threshold (3): Defines the threshold above which a long trade is triggered.
- Short Entry Z-Score Threshold (-3): Defines the threshold below which a short trade is triggered.
- Long-Term SMA Period (100): The period used to calculate the simple moving average for the spread.
- Use Hold Days (true): Enables holding trades for a specified number of days.
- Hold Days (5): Number of days to hold the trade before exiting.
- TPSL Condition (None): Defines the conditions for taking profit and stop loss.
- Take Profit (%) (30.0): The percentage at which the trade will take profit.
- Stop Loss (%) (20.0): The percentage at which the trade will stop loss.
By fine-tuning these settings, traders can optimize the strategy to suit their risk tolerance and trading style, enhancing overall performance.
Multi Timeframe Relative Strength Index {DCAquant}Overview 
The Multi Timeframe Relative Strength Index (MTF RSI) is a powerful technical analysis tool designed to provide insights into market momentum and potential trend reversals across multiple timeframes. Leveraging the Relative Strength Index (RSI) formula, this indicator offers traders a comprehensive view of market sentiment and identifies overbought and oversold conditions.
 Key Features 
 RSI Calculation: 
Utilizes the standard RSI calculation formula to measure the magnitude of recent price changes and assess the strength of market trends.
Employs a user-defined length parameter to customize the sensitivity of the RSI calculation based on trading preferences.
Multiple Timeframe Analysis:
Allows traders to analyze RSI values across up to six different timeframes, ranging from minutes to days, providing a holistic perspective on market dynamics.
Calculates RSI values independently for each selected timeframe, enabling comparison and trend identification.
Threshold Levels:
Defines overbought and oversold levels to highlight potential reversal points in market trends.
Offers flexibility in adjusting threshold levels based on individual risk tolerance and trading strategies.
Neutral Zone:
Establishes upper and lower neutral thresholds to identify periods of consolidation or sideways movement in price.
Helps traders distinguish between trending and ranging market conditions for more accurate analysis.
Moving Average Smoothing:
Provides the option to apply moving average smoothing to aggregated RSI values for enhanced clarity and reduced noise.
Enables smoother visualization of RSI trends, facilitating easier interpretation for traders.
Visual Representation:
Plots the aggregated MTF RSI values on the price chart, allowing traders to visually assess market momentum and potential reversal points.
Utilizes color-coded backgrounds to indicate Long, Short, or Neutral conditions for quick identification.
Dynamic Table Display:
Displays trading signals alongside graphical indicators (rocket for Long, snowflake for Short, and star for Neutral) in a customizable table format.
Offers flexibility in table placement and size to accommodate user preferences.
How to Use:
 Parameter Configuration: 
Adjust the length parameter to fine-tune the sensitivity of the RSI calculation based on the desired timeframe and trading strategy.
Define overbought and oversold levels to identify potential reversal points in market trends.
Customize upper and lower neutral thresholds to differentiate between trending and ranging market conditions.
Interpretation:
Monitor the aggregated MTF RSI values plotted on the price chart for signals of overbought or oversold conditions.
Pay attention to color-coded backgrounds and graphical indicators in the table for actionable trading insights.
Trading Strategy:
Consider entering Long positions when the aggregated MTF RSI is above the upper neutral threshold, indicating potential bullish momentum.
Evaluate Short opportunities when the aggregated MTF RSI falls below the lower neutral threshold, signaling possible bearish momentum.
Exercise caution during Neutral conditions, as there may be uncertainty in market direction.
Risk Management:
Combine MTF RSI analysis with robust risk management strategies, including stop-loss and take-profit levels, to manage trading risks effectively.
Practice prudent risk management and trade within your risk tolerance to minimize potential losses.
 Disclaimer 
Trading in financial markets involves risk, and past performance is not indicative of future results. The use of the MTF RSI indicator does not guarantee profits or prevent losses. Traders should conduct their own analysis, exercise caution, and seek advice from qualified financial professionals before making trading decisions.
Tetuan SniperThe TEMA and EMA Crossover Alert with SL, TP, and Order Signal strategy combines the power of Triple Exponential Moving Average (TEMA) and Exponential Moving Average (EMA) to generate high-quality trading signals. This strategy is designed to provide clear entry and exit points, manage risk through dynamic Stop Loss (SL) and Take Profit (TP) levels, and optimize trade sizes based on account balance and risk tolerance.
Key Features:
EMA and TEMA Crossover:
The strategy identifies potential buy and sell signals based on the crossover of EMA and TEMA. A buy signal is generated when TEMA crosses above EMA, and a sell signal is generated when TEMA crosses below EMA.
Dynamic Stop Loss (SL) and Take Profit (TP):
Stop Loss levels are dynamically set based on a user-defined number of pips below (for buy orders) or above (for sell orders) the lowest or highest point since the crossover.
Take Profit levels are dynamically adjusted using another TEMA, providing a flexible exit strategy that adapts to market conditions.
Lot Size Calculation:
The strategy calculates the optimal lot size based on the account balance, risk percentage per trade, and the number of maximum open orders. For JPY pairs, the lot size is adjusted by dividing by 100 to account for the different pip value.
The lot size is rounded to two decimal places for better readability and precision.
Visual Alerts and Labels:
Clear visual alerts and labels are provided for each buy and sell signal, including the recommended SL, TP, and lot size. The labels are placed in a way to avoid overlapping important chart elements.
Trend Visualization:
The area between the TEMA and EMA is colored to indicate the trend, with green for bullish trends and red for bearish trends, making it easy to visualize the market direction.
Inputs:
SL Points: Number of pips for the Stop Loss.
EMA Period: Period for the Exponential Moving Average.
TEMA Period: Period for the Triple Exponential Moving Average.
Account Balance: The total account balance for calculating the lot size.
Risk Percentage: The percentage of the account balance to risk per trade.
Take Profit TEMA Period: Period for the TEMA used to set Take Profit levels.
Lot per Pip Value: The value of 1 pip per lot.
Maximum Open Orders: The maximum number of open orders to split the balance among.
Example Usage
This strategy is suitable for traders who want to automate their trading signals and manage risk effectively. By combining TEMA and EMA crossovers with dynamic SL and TP levels and precise lot size calculation, traders can achieve a disciplined and methodical approach to trading.
Dual RSI Differential - Strategy [presentTrading]█ Introduction and How it is Different
The Dual RSI Differential Strategy introduces a nuanced approach to market analysis and trading decisions by utilizing two Relative Strength Index (RSI) indicators calculated over different time periods. Unlike traditional strategies that employ a single RSI and may signal premature or delayed entries, this method leverages the differential between a shorter and a longer RSI. This approach pinpoints more precise entry and exit points, providing a refined tool for traders to exploit market conditions effectively, particularly in overbought and oversold scenarios.
Most important: it is a good eductional code for swing trading.
For beginners, this Pine Script provides a complete function that includes crucial elements such as holding days and the option to configure take profit/stop loss settings:
- Hold Days: This feature ensures that trades are not exited too hastily, helping traders to ride out short-term market volatility. It's particularly valuable for swing trading where maintaining positions slightly longer can lead to capturing significant trends.
- TPSL Condition (None by default): This setting allows traders to focus solely on the strategy's robust entry and exit signals without being constrained by preset profit or loss limits. This flexibility is crucial for learning to adjust strategy settings based on personal risk tolerance and market observations.
BTCUSD 6h LS Performance
  
█ Strategy, How It Works: Detailed Explanation
🔶 RSI Calculation:
The RSI is a momentum oscillator that measures the speed and change of price movements. It is calculated using the formula:
RSI = 100 - (100 / (1 + RS))
Where RS (Relative Strength) = Average Gain of up periods / Average Loss of down periods.
🔶 Dual RSI Setup:
This strategy involves two RSI indicators:
RSI_Short (RSI_21): Calculated over a short period (21 days).
RSI_Long (RSI_42): Calculated over a longer period (42 days).
Differential Calculation:
The strategy focuses on the differential between these two RSIs:
RSI Differential = RSI_Long - RSI_Short
This differential helps to identify when the shorter-term sentiment diverges from longer-term trends, signaling potential trading opportunities.
BTCUSD Local picuture
  
🔶 Signal Triggers:
Entry Signal: A buy (long) signal is triggered when the RSI Differential exceeds -5, suggesting strengthening short-term momentum. Conversely, a sell (short) signal occurs when the RSI Differential falls below +5, indicating weakening short-term momentum.
Exit Signal: Trades are generally exited when the RSI Differential reverses past these thresholds, indicating a potential momentum shift.
█ Trade Direction
This strategy accommodates various trading preferences by allowing selections among long, short, or both directions, thus enabling traders to capitalize on diverse market movements and volatility.
█ Usage
The Dual RSI Differential Strategy is particularly suited for:
Traders who prefer a systematic approach to capture market trends.
Those who seek to minimize risks associated with rapid and unexpected market movements.
Traders who value strategies that can be finely tuned to different market conditions.
█ Default Settings
- Trading Direction: Both — allows capturing of upward and downward market movements.
- Short RSI Period: 21 days — balances sensitivity to market movements.
- Long RSI Period: 42 days — smoothens out longer-term fluctuations to provide a clearer market trend.
- RSI Difference Level: 5 — minimizes false signals by setting a moderate threshold for action.
Use Hold Days: True — introduces a temporal element to trading strategy, holding positions to potentially enhance outcomes.
- Hold Days: 5 — ensures that trades are not exited too hastily, helping to ride out short-term volatility.
- TPSL Condition: None — enables traders to focus solely on the strategy's entry and exit signals without preset profit or loss limits.
- Take Profit Percentage: 15% — aims for significant market moves to lock in profits.
- Stop Loss Percentage: 10% — safeguards against large losses, essential for long-term capital preservation.
Bitcoin Momentum StrategyThis is a very simple long-only strategy I've used since December 2022 to manage my Bitcoin position. 
I'm sharing it as an open-source script for other traders to learn from the code and adapt it to their liking if they find the system concept interesting.
 General Overview 
Always do your own research and backtesting - this script is not intended to be traded blindly (no script should be) and I've done limited testing on other markets beyond Ethereum and BTC, it's just a template to tweak and play with and make into one's own.
The results shown in the strategy tester are from Bitcoin's inception so as to get a large sample size of trades, and potential returns have diminished significantly as BTC has grown to become a mega cap asset, but the script includes a date filter for backtesting and it has still performed solidly in recent years (speaking from personal experience using it myself - DYOR with the date filter).
The main advantage of this system in my opinion is in limiting the max drawdown significantly versus buy & hodl. Theoretically much better returns can be made by just holding, but that's also a good way to lose 70%+ of your capital in the inevitable bear markets (also speaking from experience).
In saying all of that, the future is fundamentally unknowable and past results in no way guarantee future performance.
 System Concept: 
Capture as much Bitcoin upside volatility as possible while side-stepping downside volatility as quickly as possible.
The system uses a simple but clever momentum-style trailing stop technique I learned from one of my trading mentors who uses this approach on momentum/trend-following stock market systems.
Basically, the system "ratchets" up the stop-loss to be much tighter during high bearish volatility to protect open profits from downside moves, but loosens the stop loss during sustained bullish momentum to let the position ride.
It is invested most of the time, unless BTC is trading below its 20-week EMA in which case it stays in cash/USDT to avoid holding through bear markets. It only trades one position (no pyramiding) and does not trade short, but can easily be tweaked to do whatever you like if you know what you're doing in Pine. 
 Default parameters: 
HTF: Weekly Chart
EMA: 20-Period
ATR: 5-period
Bar Lookback: 7
 Entry Rule #1: 
Bitcoin's current price must be trading above its higher-timeframe EMA (Weekly 20 EMA).
 Entry Rule #2: 
Bitcoin must not be in 'caution' condition (no large bearish volatility swings recently). 
Enter at next bar's open if conditions are met and we are not already involved in a trade.
 "Caution" Condition: 
Defined as true if BTC's recent 7-bar swing high minus current bar's low is > 1.5x ATR, or Daily close < Daily 20-EMA.
 Trailing Stop: 
Stop is trailed 1 ATR from recent swing high, or 20% of ATR if in caution condition (ie. 0.2 ATR).
Exit on next bar open upon a close below stop loss. 
I typically use a limit order to open & exit trades as close to the open price as possible to reduce slippage, but the strategy script uses market orders. 
I've never had any issues getting filled on limit orders close to the market price with BTC on the Daily timeframe, but if the exchange has relatively low slippage I've found market orders work fine too without much impact on the results particularly since BTC has consistently remained above $20k and highly liquid.
 Cost of Trading: 
The script uses no leverage and a default total round-trip commission of 0.3% which is what I pay on my exchange based on their tier structure, but this can vary widely from exchange to exchange and higher commission fees will have a significantly negative impact on realized gains so make sure to always input the correct theoretical commission cost when backtesting any script. 
Static slippage is difficult to estimate in the strategy tester given the wide range of prices & liquidity BTC has experienced over the years and it largely depends on position size, I set it to 150 points per buy or sell as BTC is currently very liquid on the exchange I trade and I use limit orders where possible to enter/exit positions as close as possible to the market's open price as it significantly limits my slippage. 
But again, this can vary a lot from exchange to exchange (for better or worse) and if BTC volatility is high at the time of execution this can have a negative impact on slippage and therefore real performance, so make sure to adjust it according to your exchange's tendencies. 
Tax considerations should also be made based on short-term trade frequency if crypto profits are treated as a CGT event in your region.
 Summary: 
A simple, but effective and fairly robust system that achieves the goals I set for it. 
From my preliminary testing it appears it may also work on altcoins but it might need a bit of tweaking/loosening with the trailing stop distance as the default parameters are designed to work with Bitcoin which obviously behaves very differently to smaller cap assets.
Good luck out there!
Liquidity Finder🔵 Introduction 
The concept of "liquidity pool" or simply "liquidity" in technical analysis price action refers to areas on the price chart where stop losses accumulate, and the market, by reaching those areas and collecting liquidity (Stop Hunt), provides the necessary energy to move the price. This concept is prominent in the "ICT" and "Smart Money" styles. Imagine, as depicted below, the price is at a support level. The general trader mentality is that there is "demand" for the asset at this price level, and this demand will outweigh "supply" as before. So, it is likely that the price will increase. As a result, they start buying and place their stop loss below the support area.
Stop Hunt areas are essentially traders' "stop loss" levels. These are the liquidity that institutional and large traders need to fill their orders. Consequently, they penetrate the price below support areas or above resistance areas to touch their stop loss and fill their orders, and then the price trend reverses.
Cash zones are generally located under "Swings Low" and above "Swings High." More specifically, they can be categorized as support levels or resistance levels, above Double Top and Triple Top patterns, below Double Bottom and Triple Bottom patterns, above Bearish Trend lines, and below Bullish Trend lines.
 Double Top and Triple Top :
  
 Double Bottom and Triple Bottom :
  
 Bullish Trend line and Bearish Trend line :
  
🔵 How to Use 
To optimally use this indicator, you can adjust the settings according to the symbol, time frame, and your needs. These settings include the "sensitivity" of the "liquidity finder" function and the swing periods related to static and dynamic liquidity lines.
"Statics Liquidity Line Sensitivity" is a number between 0 and 0.4. Increasing this number decreases the sensitivity of the "Statics Liquidity Line Detection" function and increases the number of lines identified. The default value is 0.3.
"Dynamics Liquidity Line Sensitivity" is a number between 0.4 and 1.95. Increasing this number increases the sensitivity of the "Dynamics Liquidity Line Detection" function and decreases the number of lines identified. The default value is 1.
"Statics Period Pivot" is set to 8 by default. By changing this number, you can specify the period for the static liquidity line pivots.
"Dynamics Period Pivot" is set to 3 by default. By changing this number, you can specify the period for the dynamic liquidity line pivots.
🔵 Settings 
Access to adjust the inputs of Static Dynamic Liquidity Line Sensitivity, Dynamics Liquidity Line Sensitivity, Statics Period Pivot, and Dynamics Period Pivot is possible from this section.
Additionally, you can enable or disable liquidity lines as needed using the buttons for "Show Statics High Liquidity Line," "Show Statics Low Liquidity Line," "Show Dynamics High Liquidity Line," and "Show Dynamics Low Liquidity Line."
  
arpit bollinger bandStrategy Overview:
This strategy utilizes Bollinger Bands based on a 20-period Exponential Moving Average (EMA) with a standard deviation multiplier of 1.5. It is designed to generate early trading signals based on the relationship between the price action and the Bollinger Bands.
Bollinger Bands Calculation:
The upper Bollinger Band is calculated as the 20-period EMA of the closing prices plus 1.5 times the standard deviation of the same period.
The lower Bollinger Band is calculated as the 20-period EMA of the closing prices minus 1.5 times the standard deviation.
Entry Criteria:
Buy Signal: A buy signal is generated when the current candle's high exceeds the high of the candle two periods ago, which had closed below the lower Bollinger Band. This condition implies an anticipation of a bullish reversal.
Sell Signal: A sell signal is generated when the current candle's low falls below the low of the candle two periods ago, which had closed above the upper Bollinger Band. This condition suggests an anticipated bearish reversal.
Stop Loss and Take Profit:
The stop loss for a buy order is set slightly below the low of the current candle, and for a sell order, it is set slightly above the high of the current candle.
The take profit level is determined based on a predefined risk-reward ratio of 1:3. This means the take profit target is set at a distance three times greater than the distance between the entry price and the stop loss.
Risk Management:
The strategy includes an input option to adjust the risk-reward ratio, allowing for flexibility in managing the trade's potential risk versus reward.
Trade Execution:
The strategy automatically plots the buy and sell signals on the chart and executes the trades according to the defined conditions. It also visually indicates the stop loss levels for each trade.
Usage Notes:
This strategy is designed for use in the TradingView platform using Pine Script version 5.
It is important to backtest and paper trade the strategy before using it in live trading to understand its performance characteristics and risk profile.
The strategy should be used as part of a comprehensive trading plan, considering market conditions, trader risk tolerance, and personal trading goals.
Four WMA Strategy with TP and SLBasically I read a research paper on how they used different moving averages for long entries and short entries, and it kind of dawned on me that I always used the same one for long entry or exit, or even swing trading. So I smashed this together to see what would happen.
The strategy combines the use of four different WMAs for identifying trade entry points, along with a predefined take profit (TP) and stop loss (SL) for risk management. Here's a detailed description of its features and how it operates:
Main Features
1. **WMAs as the Core Indicator**:
- The strategy uses four WMAs with different lengths. Two WMAs (`longM1` and `longM2`) are used for long entry signals, and the other two (`shortM1` and `shortM2`) for short entry signals.
- The lengths of these WMAs are adjustable through input parameters.
2. **Trade Entry Conditions**:
- A long entry is signaled when the shorter WMA crosses under the longer WMA .
- Conversely, a short entry is signaled when the shorter WMA crosses under the longer WMA.
3. **Take Profit and Stop Loss**:
- The strategy includes a take profit and stop loss mechanism.
- The TP and SL levels are set as a percentage of the entry price, with the percentage values being adjustable through input parameters.
4. **Visual Representation**:
- The WMAs are plotted on the chart for visual aid, each with a distinct color for easy identification.
How It Works
- The strategy continuously monitors the crossing of WMAs to detect potential entry points for long and short positions.
- Upon detecting a long or short condition, it automatically enters a trade and sets the corresponding TP and SL levels based on the current price and the specified percentages.
- The strategy then actively manages the trade, exiting the position when either the TP or SL level is reached.
Drawbacks
- **Overreliance on WMAs**: The strategy heavily relies on WMAs for trade signals. While WMAs are useful for identifying trends, they might not always provide timely entry and exit signals.
- **Market Conditions**: It may not perform well in highly volatile or sideways markets where WMA crossovers could lead to false signals.
- **Risk Management**: The fixed percentage for TP and SL might not be suitable for all market conditions. Traders might need to adjust these values frequently based on market volatility and their risk tolerance. 
Apparently I need to emphasize to use brains when using indicators and setting them up to achieve the results you can or want. Also risk of 12% is considered very high so I lowered the numbers to 5%, which tanked the profits, try adjusting them on your own. Check the properties settings for more info on comission and slippage. 
Conclusion
The "Four WMA Strategy with TP and SL" is suitable for traders who prefer a moving average-based approach to trading, combined with a straightforward mechanism for risk management through take profit and stop loss. However, like all strategies, it should be used with an understanding of its limitations and ideally tested thoroughly in various market conditions before applying it to live trading.
Ichimoku Clouds Strategy Long and ShortOverview: 
The Ichimoku Clouds Strategy leverages the Ichimoku Kinko Hyo technique to offer traders a range of innovative features, enhancing market analysis and trading efficiency. This strategy is distinct in its combination of standard methodology and advanced customization, making it suitable for both novice and experienced traders.
 Unique Features: 
 
 Enhanced Interpretation:  The strategy introduces weak, neutral, and strong bullish/bearish signals, enabling detailed interpretation of the Ichimoku cloud and direct chart plotting.
 Configurable Trading Periods:  Users can tailor the strategy to specific market windows, adapting to different market conditions.
 Dual Trading Modes:  Long and Short modes are available, allowing alignment with market trends.
 Flexible Risk Management:  Offers three styles in each mode, combining fixed risk management with dynamic indicator states for versatile trade management.
 Indicator Line Plotting:  Enables plotting of Ichimoku indicator lines on the chart for visual decision-making support.
 
 Methodology: 
The strategy utilizes the standard Ichimoku Kinko Hyo model, interpreting indicator values with settings adjustable through a user-friendly menu. This approach is enhanced by TradingView's built-in strategy tester for customization and market selection. 
 Risk Management: 
Our approach to risk management is dynamic and indicator-centric. With data from the last year, we focus on dynamic indicator states interpretations to mitigate manual setting causing human factor biases. Users still have the option to set a fixed stop loss and/or take profit per position using the corresponding parameters in settings, aligning with their risk tolerance.
  Backtest Results: 
 
 Operating window:  Date range of backtests is 2023.01.01 - 2024.01.04. It is chosen to let the strategy to close all opened positions.
 Commission and Slippage:  Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
 Maximum Single Position Loss:  -6.29%
 Maximum Single Profit:  22.32%
 Net Profit:  +10 901.95 USDT (+109.02%)
 Total Trades:  119 (51.26% profitability)
 Profit Factor:  1.775
 Maximum Accumulated Loss:  4 185.37 USDT (-22.87%)
 Average Profit per Trade:  91.67 USDT (+0.7%)
 Average Trade Duration:  56 hours
 
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.  Backtest is calculated using deep backtest option in TradingView built-in strategy tester
 How to Use: 
 
 Add the script to favorites for easy access.
 Apply to the desired chart and timeframe (optimal performance observed on the 1H chart, ForEx or cryptocurrency top-10 coins with quote asset USDT).
 Configure settings using the dropdown choice list in the built-in menu.
 Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
 
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
Support & Resistance AI (K means/median) [ThinkLogicAI]█  OVERVIEW 
K-means is a clustering algorithm commonly used in machine learning to group data points into distinct clusters based on their similarities. While K-means is not typically used directly for identifying support and resistance levels in financial markets, it can serve as a tool in a broader analysis approach.
Support and resistance levels are price levels in financial markets where the price tends to react or reverse. Support is a level where the price tends to stop falling and might start to rise, while resistance is a level where the price tends to stop rising and might start to fall. Traders and analysts often look for these levels as they can provide insights into potential price movements and trading opportunities.
█  BACKGROUND 
The K-means algorithm has been around since the late 1950s, making it more than six decades old. The algorithm was introduced by Stuart Lloyd in his 1957 research paper "Least squares quantization in PCM" for telecommunications applications. However, it wasn't widely known or recognized until James MacQueen's 1967 paper "Some Methods for Classification and Analysis of Multivariate Observations," where he formalized the algorithm and referred to it as the "K-means" clustering method.
So, while K-means has been around for a considerable amount of time, it continues to be a widely used and influential algorithm in the fields of machine learning, data analysis, and pattern recognition due to its simplicity and effectiveness in clustering tasks.
█  COMPARE AND CONTRAST SUPPORT AND RESISTANCE METHODS 
 1)   K-means Approach: 
 
 Cluster Formation:  After applying the K-means algorithm to historical price change data and visualizing the resulting clusters, traders can identify distinct regions on the price chart where clusters are formed. Each cluster represents a group of similar price change patterns.
 Cluster Analysis:  Analyze the clusters to identify areas where clusters tend to form. These areas might correspond to regions of price behavior that repeat over time and could be indicative of support and resistance levels.
 Potential Support and Resistance Levels:  Based on the identified areas of cluster formation, traders can consider these regions as potential support and resistance levels. A cluster forming at a specific price level could suggest that this level has been historically significant, causing similar price behavior in the past.
 Cluster Standard Deviation:  In addition to looking at the means (centroids) of the clusters, traders can also calculate the standard deviation of price changes within each cluster. Standard deviation is a measure of the dispersion or volatility of data points around the mean. A higher standard deviation indicates greater price volatility within a cluster.
 Low Standard Deviation:  If a cluster has a low standard deviation, it suggests that prices within that cluster are relatively stable and less likely to exhibit sudden and large price movements. Traders might consider placing tighter stop-loss orders for trades within these clusters.
 High Standard Deviation:  Conversely, if a cluster has a high standard deviation, it indicates greater price volatility within that cluster. Traders might opt for wider stop-loss orders to allow for potential price fluctuations without getting stopped out prematurely.
 Cluster Density:  Each  data point is assigned to a cluster so a cluster that is more dense will act more like gravity and 
 
 2)  Traditional Approach: 
 
 Trendlines:  Draw trendlines connecting significant highs or lows on a price chart to identify potential support and resistance levels.
 Chart Patterns:  Identify chart patterns like double tops, double bottoms, head and shoulders, and triangles that often indicate potential reversal points.
 Moving Averages:  Use moving averages to identify levels where the price might find support or resistance based on the average price over a specific period.
 Psychological Levels:  Identify round numbers or levels that traders often pay attention to, which can act as support and resistance.
 Previous Highs and Lows:  Identify significant previous price highs and lows that might act as support or resistance.
 
The key difference lies in the approach and the foundation of these methods. Traditional methods are based on well-established principles of technical analysis and market psychology, while the K-means approach involves clustering price behavior without necessarily incorporating market sentiment or specific price patterns.
It's important to note that while the K-means approach might provide an interesting way to analyze price data, it should be used cautiously and in conjunction with other traditional methods. Financial markets are influenced by a wide range of factors beyond just price behavior, and the effectiveness of any method for identifying support and resistance levels should be thoroughly tested and validated. Additionally, developments in trading strategies and analysis techniques could have occurred since my last update.
█  K MEANS ALGORITHM 
The algorithm for K means is as follows:
 
 Initialize cluster centers
 assign data to clusters based on minimum distance
 calculate cluster center by taking the average or median of the clusters
 repeat steps 1-3 until cluster centers stop moving
 
█  LIMITATIONS OF K MEANS 
There are 3 main limitations of this algorithm:
 
 Sensitive to Initializations: K-means is sensitive to the initial placement of centroids. Different initializations can lead to different cluster assignments and final results. 
 Assumption of Equal Sizes and Variances: K-means assumes that clusters have roughly equal sizes and spherical shapes. This may not hold true for all types of data. It can struggle with identifying clusters with uneven densities, sizes, or shapes.
 Impact of Outliers: K-means is sensitive to outliers, as a single outlier can significantly affect the position of cluster centroids. Outliers can lead to the creation of spurious clusters or distortion of the true cluster structure.
 
█  LIMITATIONS IN APPLICATION OF K MEANS IN TRADING 
Trading data often exhibits characteristics that can pose challenges when applying indicators and analysis techniques. Here's how the limitations of outliers, varying scales, and unequal variance can impact the use of indicators in trading:
 
 Outliers  are data points that significantly deviate from the rest of the dataset. In trading, outliers can represent extreme price movements caused by rare events, news, or market anomalies. Outliers can have a significant impact on trading indicators and analyses:
   Indicator Distortion:  Outliers can skew the calculations of indicators, leading to   misleading signals. For instance, a single extreme price spike could cause indicators like moving averages or RSI (Relative Strength Index) to give false signals.
   Risk Management:  Outliers can lead to overly aggressive trading decisions if not  properly accounted for. Ignoring outliers might result in unexpected losses or missed opportunities to adjust trading strategies.
 Different Scales:  Trading data often includes multiple indicators with varying units and scales. For example, prices are typically in dollars, volume in units traded, and oscillators have their own scale. Mixing indicators with different scales can complicate analysis:
  Normalization:  Indicators on different scales need to be normalized or standardized to ensure they contribute equally to the analysis. Failure to do so can lead to one indicator dominating the analysis due to its larger magnitude.
  Comparability:  Without normalization, it's challenging to directly compare the significance of indicators. Some indicators might have a larger numerical range and could overshadow others.
 Unequal Variance:   Unequal variance in trading data refers to the fact that some indicators might exhibit higher volatility than others. This can impact the interpretation of signals and the performance of trading strategies:
  Volatility Adjustment:  When combining indicators with varying volatility, it's essential to adjust for their relative volatilities. Failure to do so might lead to overemphasizing or underestimating the importance of certain indicators in the trading strategy.
  Risk Assessment:  Unequal variance can impact risk assessment. Indicators with higher volatility might lead to riskier trading decisions if not properly taken into account.
 
█  APPLICATION OF THIS INDICATOR 
This indicator can be used in 2 ways:
 1) Make a directional trade: 
 
 If a trader thinks price will go higher or lower and price is within a cluster zone, The trader can take a position and place a stop on the 1 sd band around the cluster.  As one can see below, the trader can go long the green arrow and place a stop on the one standard deviation mark for that cluster below it at the red arrow.  using this we can calculate a risk to reward ratio.
 
 Calculating risk to reward:   targeting a risk reward ratio of 2:1, the trader could clearly make that given that the next resistance area above that in the orange cluster exceeds this risk reward ratio.
 
  
 2) Take a reversal Trade: 
 
 We can use cluster centers (support and resistance levels) to go in the opposite direction that price is currently moving in hopes of price forming a pivot and reversing off this level.    
 Similar to the directional trade, we can use the standard deviation of the cluster to place a stop just in case we are wrong.  
 In this example below we can see that shorting on the red arrow and placing a stop at the one standard deviation above this cluster would give us a profitable trade with minimal risk.
 Using the cluster density table in the upper right informs the trader just how dense the cluster is.  Higher density clusters will give a higher likelihood of a pivot forming at  these levels and price being rejected and switching direction  with a larger move.
 
  
█  FEATURES & SETTINGS 
 General Settings: 
 
 Number of clusters:  The user can select from 3 to five clusters.  A good rule of thumb is that if you are trading intraday, less is more  (Think 3 rather than 5).  For daily 4 to 5 clusters is good.
 Cluster Method:  To get around the outlier limitation of k means clustering,  The median was added.   This gives the user the ability to choose either k means or k median clustering.  K means is the preferred method if the user things there are no large outliers, and if there appears to be large outliers or it is assumed there are then K medians is preferred.
 Bars back To train on:  This will be the amount of bars to include in the clustering.  This number is important so that the user includes bars that are recent but not so far back that they are out of the scope of where price can be.  For example the last 2 years we have been in a range on the sp500 so 505 days in this setting would be more relevant than say looking back 5 years ago because price would have to move far to get there.
 Show SD Bands:  Select this to show the 1 standard deviation bands around the support and resistance level or unselect this to just show the support and resistance level by itself.
 
 Features: 
Besides the support and resistance levels and standard deviation bands, this indicator gives a table in the upper right hand corner to show the density of each cluster (support and resistance level) and is color coded to the cluster line on the chart.  Higher density clusters mean price has been there previously more than lower density clusters and could mean a higher likelihood of a reversal when price reaches these areas.
█  WORKS CITED 
 
 Victor Sim, "Using K-means Clustering to Create Support and Resistance", 2020, towardsdatascience.com
 Chris Piech, "K means", stanford.edu
 
█  ACKNOLWEDGMENTS 
@jdehorty- Thanks for the publish template.  It made organizing my thoughts and work alot easier.
[OKX Signal Bot] Indicator Script Set Up TemplateDiscover the power of the Turtle Trade Channels Indicator (TUTCI), an innovative tool that integrates the time-tested principles of the legendary Turtle Trade system. This groundbreaking system shattered the belief that successful traders are born, not made, by transforming ordinary individuals into profitable traders.
The Turtle Trade Experiment, which achieved a remarkable 80% annual return over four years and amassed a staggering $150 million, showcased the immense potential of this trend-following strategy. Unlike the conventional "buy low and sell high" approach, the Turtle Trade system embraces a different philosophy—one of capturing substantial profits by following prevailing trends.
At the heart of the Turtle Trade Channels Indicator lies the concept of Donchian Channels, a powerful technical indicator developed by Richard Donchian. Building upon this foundation, the main rule of TUTCI is to identify 20-day breakouts and capitalize on them, while simultaneously utilizing a profit-taking strategy based on breaching 10-day highs or lows.
For long trades, the indicator signals a buying opportunity when the price breaks above the 20-day high. Conversely, for short trades, a selling opportunity arises when the price falls below the 20-day low. This systematic approach allows traders to align themselves with the prevailing momentum, capturing significant price movements.
To further enhance trading precision, TUTCI incorporates two key lines. The red line represents the trading line, indicating the direction of the trend. Price bars above the trend line suggest an uptrend, while those below indicate a downtrend. The dotted blue line serves as the exit line, guiding traders to close their positions when price action breaches the 10-day high or low. This rule safeguards profits and helps traders avoid potential trend reversals.
The Turtle Trade Channels Indicator (TUTCI) is a versatile tool applicable to various financial markets, including stocks, commodities, and forex. By harnessing the power of breakouts and integrating profit-taking rules, this indicator empowers traders to capitalize on favorable trading opportunities while managing risk effectively.
As with any trading strategy, it is crucial to conduct thorough backtesting and evaluation of the TUTCI system before implementing it in live trading. Traders can customize the indicator's parameters to align with their trading preferences and adapt to changing market conditions. Employing sound risk management techniques, such as position sizing and stop-loss orders, is paramount to protect capital and minimize potential losses.
Experience the transformational potential of the Turtle Trade Channels Indicator (TUTCI) and embark on a journey of trend following, capturing significant profits, and achieving trading success.
These scripts are only functioning as sample script templates to support okx alert standards. It is not intended to provide any investment, tax, or legal advice, nor should it be considered an offer to purchase, sell, hold or offer any services relating to digital assets. Digital assets, including stablecoins, involve a high degree of risk, can fluctuate greatly, and can even become worthless. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition and risk tolerance. OKX does not provide investment or asset recommendations. You are solely responsible for your investment decisions, and OKX is not responsible for any potential losses. Past performance is not indicative of future results. Please consult your legal/tax/investment professional for questions about your specific circumstances.
A.I Fibonacci [Paradox]Description:
The A.I fibonacci is a tool designed to assist traders in identifying potential price levels following a retracement. Unlike many other Fibonacci indicators available, this script is tailored to highlight the most crucial levels for entries, take profits, and stop losses.
Key Features:
Automatic Calculation: The script automatically calculates and plots Fibonacci extension levels based on the price movement and the highs and the lows on the chart.
Optimal Levels: It emphasizes the most relevant levels for making informed trading decisions, ensuring traders focus on what specific levels.
Versatility: Suitable for all markets, making it a versatile tool for traders across different asset classes.
User-Friendly: Designed with both novice and experienced traders in mind, the script is easy to use and interpret.
How It Stands Out:
While there are numerous Fibonacci tools available, the A.I Fibonacci is distinct in its approach. It not only calculates potential price reversal areas but also pinpoints possible price levels after a retracement is completed. This dual functionality ensures traders have a comprehensive view of the market.
How to Use:
Apply the script to your desired chart.
Observe the plotted Fibonacci levels.
Use these levels to determine potential entry, exit, and stop-loss points.
Green - Entry levels
Red - Stop Loss Levels
Yellow - Take Profit Levels
Applicability:
A.I Fibonacci is designed for all markets, making it a versatile tool for forex, stocks, commodities, and more.
Conditions for Use:
The script performs optimally under various market conditions. However, as with all technical tools, it's recommended to use it in conjunction with other indicators and analysis methods for best results.
Alpha Fractal BandsWilliams fractals are remarkable support and resistance levels used by many traders. However, it can sometimes be challenging to use them frequently and get confirmation from other oscillators and indicators. With the new "Alpha Fractal Bands", a unique blend of Williams Fractals and Bollinger Bands emerges, offering a fresh perspective. Extremes can be utilized as price reversals or for taking profits. I look forward to hearing your thoughts. Best regards... Happy trading!
  
An easy solution for long positions is to:
Identify a bullish trend or a potential entry point for a long position.
Set a stop-loss order to limit potential losses if the trade goes against you.
Determine a target price or take-profit level to lock in profits.
Consider using technical indicators or analysis tools to confirm the strength of the bullish trend.
Regularly monitor the trade and make necessary adjustments based on market conditions.
  
An easy solution for short positions could be to follow these steps:
Identify a bearish trend or a potential entry point for a short position.
Set a stop-loss order to limit potential losses if the trade goes against you.
Determine a target price or take-profit level to lock in profits.
Consider using technical indicators or analysis tools to confirm the strength of the bearish trend.
Regularly monitor the trade and make necessary adjustments based on market conditions.
Remember, it's important to conduct thorough research and analysis before entering any trade and to manage your risk effectively.
To stay updated with the content, don't forget to follow and engage with it on TV, my friends. Remember to leave comments as well :)
Antares_messages_publicLibrary   "Antares_messages_public" 
This library add messages for yours strategy for use in Antares trading system for binance and bybit exchanges. 
Данная библиотека позволяет формировать сообщения в алертах стратегий для Antares в более упрощенном для пользователя режиме, включая всплывающие подсказки и т.д.
 set_leverage(token, market, ticker_id, leverage) 
  Set leverage for ticker on specified market.
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     leverage (float) : (float)  leverage level. Устанавливаемое плечо.
  Returns: 'Set leverage message'.
 pause(time_pause) 
  Set pause in message.  '::' -left and  '::' -right included.
  Parameters:
     time_pause (int) 
 LongLimit(token, market, ticker_id, type_qty, quantity, price, orderId, leverageforqty) 
  Buy order with limit price and quantity. 
Лимитный ордер на покупку(в лонг).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
     orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Limit Buy order'. Лимитный ордер на покупку (лонг).
 LongMarket(token, market, ticker_id, type_qty, quantity, leverageforqty) 
  Market Buy order with quantity. 
Рыночный ордер на покупку (в лонг).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Market Buy order'. Маркетный ордер на покупку (лонг).
 ShortLimit(token, market, ticker_id, type_qty, quantity, price, leverageforqty, orderId) 
  Sell order with limit price and quantity.
Лимитный ордер на продажу(в шорт).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
     orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
  Returns: 'Limit Sell order'. Лимитный ордер на продажу (шорт).
 ShortMarket(token, market, ticker_id, type_qty, quantity, leverageforqty) 
  Sell by market price and quantity.
Рыночный ордер на продажу(в шорт).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Market Sell order'. Маркетный ордер на продажу (шорт).
 Cancel_by_ticker(token, market, ticker_id) 
  Cancel all orders for market and ticker in setups. Отменяет все ордера на заданной бирже и заданном токене(паре).
  Parameters:
     token (string) 
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
  Returns: 'Cancel all orders'. Отмена всех ордеров на заданной бирже и заданном токене(паре).
 Cancel_by_id(token, market, ticker_id, orderId) 
  Cancel order by Id for market and ticker in setups. Отменяет ордер по Id на заданной бирже и заданном токене(паре).
  Parameters:
     token (string) 
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     orderId (string) 
  Returns: 'Cancel order'. Отмена ордера по Id на заданной бирже и заданном токене(паре).
 Close_positions(token, market, ticker_id) 
  Close all positions for market and ticker in setups. Закрывает все позиции на заданной бирже и заданном токене(паре).
  Parameters:
     token (string) 
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
  Returns: 'Close positions'
 CloseLongLimit(token, market, ticker_id, type_qty, quantity, price, orderId, leverageforqty) 
  Close limit order for long position. (futures)
Лимитный ордер на продажу(в шорт) для закрытия лонговой позиции(reduceonly).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
     orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Limit Sell order reduce only (close long position)'. Лимитный ордер на продажу для снижения текущего лонга(в шорт не входит).
 CloseLongMarket(token, market, ticker_id, type_qty, quantity, leverageforqty) 
  Close market order for long position.
Рыночный ордер на продажу(в шорт) для закрытия лонговой позиции(reduceonly).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Market Sell order reduce only (close long position)'. Ордер на снижение/закрытие текущего лонга(в шорт не входит) по рыночной цене.
 CloseShortLimit(token, market, ticker_id, type_qty, quantity, price, orderId, leverageforqty) 
  Close limit order for short position.
Лимитный ордер на покупку(в лонг) для закрытия шортовой позиции(reduceonly).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
     orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Limit Buy order reduce only (close short position)' . Лимитный ордер на покупку (лонг) для сокращения/закрытия текущего шорта.
 CloseShortMarket(token, market, ticker_id, type_qty, quantity, leverageforqty) 
  Set Close limit order for long position.
Рыночный ордер на покупку(в лонг) для сокращения/закрытия шортовой позиции(reduceonly).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Market Buy order reduce only (close short position)'. Маркетного ордера на покупку (лонг) для сокращения/закрытия текущего шорта.
 cancel_all_close(token, market, ticker_id) 
  Parameters:
     token (string) 
     market (string) 
     ticker_id (string) 
 limit_tpsl_bybitfu(token, ticker_id, order_id, side, type_qty, quantity, price, tp_price, sl_price, leverageforqty) 
  Set multi order for Bybit : limit + takeprofit + stoploss
Выставление тройного ордера на Bybit лимитка со стоплоссом и тейкпрофитом
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     order_id (string) 
     side (bool) : (bool) "buy side" if true or "sell side" if false. true для лонга, false для шорта.
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     price (float) : (float) price for limit order by 'side'. Цена лимитного ордера
     tp_price (float) : (float) price for take profit order. 
     sl_price (float) : (float) price for stoploss order
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: Set multi order for Bybit : limit + takeprofit + stoploss.
 replace_limit_tpsl_bybitfu(token, ticker_id, order_id, side, type_qty, quantity, price, tp_price, sl_price, leverageforqty) 
  Change multi order for Bybit : limit + takeprofit + stoploss
Изменение тройного ордера на Bybit лимитка со стоплоссом и тейкпрофитом
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     order_id (string) 
     side (bool) : (bool) "buy side" if true or "sell side" if false. true для лонга, false для шорта.
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
     price (float) : (float) price for limit order by 'side'. Цена лимитного ордера
     tp_price (float) : (float) price for take profit order. 
     sl_price (float) : (float) price for stoploss order
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: Set multi order for Bybit : limit + takeprofit + stoploss.
 long_stop(token, market, ticker_id, type_qty, quantity, l_stop, leverageforqty) 
  Stop market order for long position 
Рыночный стоп-ордер на продажу для закрытия лонговой позиции.
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size. Размер ордера.
     l_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Stop Market Sell order (close long position)'. Маркетный стоп-ордер на снижения/закрытия текущего лонга.
 short_stop(token, market, ticker_id, type_qty, quantity, s_stop, leverageforqty) 
  Stop market order for short position 
Рыночный стоп-ордер на покупку(в лонг) для закрытия шорт позиции.
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size. Размер ордера.
     s_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Stop Market Buy order (close short position)'. Маркетный стоп-ордер на снижения/закрытия текущего шорта.
 change_stop_l(token, market, ticker_id, type_qty, quantity, l_stop, leverageforqty) 
  Change Stop market order for long position 
Изменяем стоп-ордер на продажу(в шорт) для закрытия лонг позиции.
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size. Размер ордера.
     l_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Change Stop Market Buy order (close long position)'. Смещает цену активации Маркетного стоп-ордер на снижения/закрытия текущего лонга.
 change_stop_s(token, market, ticker_id, type_qty, quantity, s_stop, leverageforqty) 
  Change Stop market order for short position 
Смещает цену активации Рыночного стоп-ордера на покупку(в лонг) для закрытия шорт позиции.
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) 
     quantity (float) : (float) orders size. Размер ордера.
     s_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Change Stop Market Buy order (close short position)'. Смещает цену активации Маркетного стоп-ордер на снижения/закрытия текущего шорта.
 open_long_position(token, market, ticker_id, type_qty, quantity, l_stop, leverageforqty) 
  Cancel and close all orders and positions by ticker , then open Long position by market price with stop order
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает лонг по маркету с выставлением стопа (переворот позиции, при необходимости).
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size. Размер ордера.
     l_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
     leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'command_all_close + LongMarket + long_stop.
 open_short_position(token, market, ticker_id, type_qty, quantity, s_stop, leverageforqty) 
  Cancel and close all orders and positions , then open Short position by market price with stop order 
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает шорт по маркету с выставлением стопа(переворот позиции, при необходимости).
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) orders size. Размер ордера.
     s_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
     leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'command_all_close + ShortMarket + short_stop'.
 open_long_trade(token, market, ticker_id, type_qty, quantity, l_stop, qty_ex1, price_ex1, qty_ex2, price_ex2, qty_ex3, price_ex3, leverageforqty) 
  Cancell and close all orders and positions , then open Long position by market price with stop order and take 1 ,take 2, take 3
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает лонг по маркету с выставлением стопа и 3 тейками (переворот позиции, при необходимости).
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     quantity (float) : (float) enter order size, see at type_qty. Размер ордера входа, согласно type_qty.
     l_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
     qty_ex1 (float) : (float). Quantity for 1th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 1го тейка, согласно type_qty.. Если 0, то строка для этого тейка не формируется
     price_ex1 (float) : (float). Price for 1th take , if = 0 string for order dont set. Цена лимитного ордера для 1го тейка. Если 0, то строка для этого тейка не формируется
     qty_ex2 (float) : (float). Quantity for 2th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
     price_ex2 (float) : (float). Price for 2th take, if = 0 string for order dont set. Цена лимитного ордера для 2го тейка. Если 0, то строка для этого тейка не формируется
     qty_ex3 (float) : (float). Quantity for 3th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
     price_ex3 (float) : (float). Price for 3th take, if = 0 string for order dont set. Цена лимитного ордера для 3го тейка. Если 0, то строка для этого тейка не формируется
     leverageforqty (int) 
  Returns: 'cancel_all_close + LongMarket + long_stop + CloseLongLimit1 + CloseLongLimit2+CloseLongLimit3'.
 open_short_trade(token, market, ticker_id, type_qty, quantity, s_stop, qty_ex1, price_ex1, qty_ex2, price_ex2, qty_ex3, price_ex3, leverageforqty) 
  Cancell and close all orders and positions , then open Short position by market price with stop order and take 1 and take 2 
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает шорт по маркету с выставлением стопа и 3 тейками (переворот позиции, при необходимости).
  Parameters:
     token (string) 
     market (string) : (string) 'binance' , 'binancefru'  etc.. Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) 
     quantity (float) 
     s_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
     qty_ex1 (float) : (float). Quantity for 1th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 1го тейка, согласно type_qty.. Если 0, то строка для этого тейка не формируется
     price_ex1 (float) : (float). Price for 1th take , if = 0 string for order dont set. Цена лимитного ордера для 1го тейка. Если 0, то строка для этого тейка не формируется
     qty_ex2 (float) : (float). Quantity for 2th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
     price_ex2 (float) : (float). Price for 2th take, if = 0 string for order dont set. Цена лимитного ордера для 2го тейка. Если 0, то строка для этого тейка не формируется
     qty_ex3 (float) : (float). Quantity for 3th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
     price_ex3 (float) : (float). Price for 3th take, if = 0 string for order dont set. Цена лимитного ордера для 3го тейка. Если 0, то строка для этого тейка не формируется
     leverageforqty (int) 
  Returns: 'command_all_close + ShortMarket + short_stop + CloseShortLimit + CloseShortLimit(2)'.
 Multi_LongLimit(token, market, ticker_id, type_qty, qty1, price1, qty2, price2, qty3, price3, qty4, price4, qty5, price5, qty6, price6, qty7, price7, qty8, price8, leverageforqty) 
  8 or less Buy orders with limit price and quantity. 
До 8 Лимитных ордеров на покупку(в лонг).
  Parameters:
     token (string) : (integer or 0) token for trade in system, if  = 0 then token part mess is empty. Токен,  При значениb = 0 не включается в формирование строки алерта.
     market (string) : (string) Spot 'binance' , 'bybit' . Futures  ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
     ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
     type_qty (string) : (string) type of quantity:  1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
     qty1 (float) 
     price1 (float) 
     qty2 (float) 
     price2 (float) 
     qty3 (float) 
     price3 (float) 
     qty4 (float) 
     price4 (float) 
     qty5 (float) 
     price5 (float) 
     qty6 (float) 
     price6 (float) 
     qty7 (float) 
     price7 (float) 
     qty8 (float) 
     price8 (float) 
     leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
  Returns: 'Limit Buy order'. Лимитный ордер на покупку (лонг).
Advanced VWAP_Pullback Strategy_Trend-Template QualifierGeneral Description and Unique Features of this Script 
 Introducing the Advanced VWAP Momentum-Pullback Strategy (long-only) that offers several unique features: 
1.	Our script/strategy utilizes Mark Minervini's Trend-Template as a qualifier for identifying stocks and other financial securities in confirmed uptrends. Mark Minervini, a 2x US Investment Champion, developed the Trend-Template, which covers eight different and independent characteristics that can be adjusted and optimized in this trend-following strategy to ensure the best results. The strategy will only trigger buy-signals in case the optimized qualifiers are being met.
2.	Our strategy is based on the supply/demand balance in the market, making it timeless and effective across all timeframes. Whether you are day trading using 1- or 5-min charts or swing-trading using daily charts, this strategy can be applied and works very well.
3.	We have also integrated technical indicators such as the RSI and the MA / VWAP crossover into this strategy to identify low-risk pullback entries in the context of confirmed uptrends. By doing so, the risk profile of this strategy and drawdowns are being reduced to an absolute minimum.
 Minervini’s Trend-Template and the ‘Stage-Analysis’ of the Markets 
This strategy is a so-called 'long-only' strategy. This means that we only take long positions, short positions are not considered. 
The best market environment for such strategies are periods of stable upward trends in the so-called stage 2 - uptrend. 
In stable upward trends, we increase our market exposure and risk. 
In sideways markets and downward trends or bear markets, we reduce our exposure very quickly or go 100% to cash and wait for the markets to recover and improve. This allows us to avoid major losses and drawdowns. 
 This simple rule gives us a significant advantage over most undisciplined traders and amateurs! 
 
'The Trend is your Friend'. This is a very old but true quote.
What's behind it???
• 98% of stocks made their biggest gains in a Phase 2 upward trend.
• If a stock is in a stable uptrend, this is evidence that larger institutions are buying the stock sustainably.
• By focusing on stocks that are in a stable uptrend, the chances of profit are significantly increased.
• In a stable uptrend, investors know exactly what to expect from further price developments. This makes it possible to locate low-risk entry points. 
The goal is not to buy at the lowest price – the goal is to buy at the right price!
Each stock goes through the same maturity cycle – it starts at stage 1 and ends at stage 4
   
 
Stage 1 – Neglect Phase – Consolidation
Stage 2 – Progressive Phase – Accumulation
Stage 3 – Topping Phase – Distribution
Stage 4 – Downtrend – Capitulation
This strategy focuses on identifying stocks in confirmed stage 2 uptrends. This in itself gives us an advantage over long-term investors and less professional traders.
By focusing on stocks in a stage 2 uptrend, we avoid losses in downtrends (stage 4) or less profitable consolidation phases (stages 1 and 3). We are fully invested and put our money to work for us, and we are fully invested when stocks are in their stage 2 uptrends.
But how can we use technical chart analysis to find stocks that are in a stable stage 2 uptrend?
Mark Minervini has developed the so-called 'trend template' for this purpose. This is an essential part of our JS-TechTrading pullback strategy. For our watchlists, only those individual values that meet the tough requirements of Minervini's trend template are eligible.
 The Trend Template 
•	200d MA increasing over a period of at least 1 month, better 4-5 months or longer
•	150d MA above 200d MA
•	50d MA above 150d MA and 200d MA
•	Course above 50d MA, 150d MA and 200d MA
•	Ideally, the 50d MA is increasing over at least 1 month
•	Price at least 25% above the 52w low
•	Price within 25% of 52w high
•	High relative strength according to IBD. 
NOTE: In this basic version of the script, the Trend-Template has to be used as a separate indicator on TradingView (Public Trend-Template indicators are available in TradingView – community scripts). It is recommended to only execute buy signals in case the stock or financial security is in a stage 2 uptrend, which means that the criteria of the trend-template are fulfilled.
This strategy can be applied to all timeframes from 5 min to daily.
 The VWAP Momentum-Pullback Strategy 
For the JS-TechTrading VWAP Momentum-Pullback Strategy, only stocks and other financial instruments that meet the selected criteria of Mark Minervini's trend template are recommended for algorithmic trading with this startegy.
A further prerequisite for generating a buy signals is that the individual value is in a short-term oversold state (RSI). 
When the selling pressure is over and the continuation of the uptrend can be confirmed by the MA / VWAP crossover after reaching a price low, a buy signal is issued by this strategy.
Stop-loss limits and profit targets can be set variably. You also have the option to make use of the trailing stop exit strategy.
  
 Relative Strength Index (RSI) 
The Relative Strength Index (RSI) is a technical indicator developed by Welles Wilder in 1978. The RSI is used to perform a market value analysis and identify the strength of a trend as well as overbought and oversold conditions. The indicator is calculated on a scale from 0 to 100 and shows how much an asset has risen or fallen relative to its own price in recent periods.
The RSI is calculated as the ratio of average profits to average losses over a certain period of time. A high value of the RSI indicates an overbought situation, while a low value indicates an oversold situation. Typically, a value > 70 is considered an overbought threshold and a value < 30 is considered an oversold threshold. A value above 70 signals that a single value may be overvalued and a decrease in price is likely , while a value below 30 signals that a single value may be undervalued and an increase in price is likely.
For example, let's say you're watching a stock XYZ. After a prolonged falling movement, the RSI value of this stock has fallen to 26. This means that the stock is oversold and that it is time for a potential recovery. Therefore, a trader might decide to buy this stock in the hope that it will rise again soon.
The MA / VWAP Crossover Trading Strategy
This strategy combines two popular technical indicators: the Moving Average (MA) and the Volume Weighted Average Price (VWAP). The MA VWAP crossover strategy is used to identify potential trend reversals and entry/exit points in the market.
The VWAP is calculated by taking the average price of an asset for a given period, weighted by the volume traded at each price level. The MA, on the other hand, is calculated by taking the average price of an asset over a specified number of periods. When the MA crosses above the VWAP, it suggests that buying pressure is increasing, and it may be a good time to enter a long position. When the MA crosses below the VWAP, it suggests that selling pressure is increasing, and it may be a good time to exit a long position or enter a short position.
Traders typically use the MA VWAP crossover strategy in conjunction with other technical indicators and fundamental analysis to make more informed trading decisions. As with any trading strategy, it is important to carefully consider the risks and potential rewards before making any trades.
This strategy is applicable to all timeframes and the relevant parameters for the underlying indicators (RSI and MA/VWAP) can be adjusted and optimized as needed. 
   
 Backtesting 
Backtesting gives outstanding results on all timeframes and drawdowns can be reduced to a minimum level. In this example, the hourly chart for MCFT has been used.
Settings for backtesting are:
-	Period from Jan 2020 until March 2023
-	Starting capital 100k USD
-	Position size = 25% of equity
-	0.01% commission = USD 2.50.- per Trade
-	Slippage = 2 ticks
 Other comments 
- This strategy has been designed to identify the most promising, highest probability entries and trades for each stock or other financial security.
- The combination of the Trend-Template and the RSI qualifiers results in a highly selective strategy which only considers the most promising swing-trading entries. As a result, you will normally only find a low number of trades for each stock or other financial security per year in case you apply this strategy for the daily charts. Shorter timeframes will result in a higher number of trades / year.
- Consequently, traders need to apply this strategy for a full watchlist rather than just one financial security.
Open Interest Profile (OI)- By LeviathanThis script implements the concept of Open Interest Profile, which can help you analyze the activity of traders and identify the price levels where they are opening/closing their positions. This data can serve as a confluence for finding the areas of support and resistance , targets and placing stop losses. OI profiles can be viewed in the ranges of days, weeks, months, Tokyo sessions, London sessions and New York sessions. 
 A short introduction to Open Interest  
Open Interest is a metric that measures the total amount of open derivatives contracts in a specific market at a given time. A valid contract is formed by both a buyer who opens a long position and a seller who opens a short position. This means that OI represents the total value of all open longs and all open shorts, divided by two. For example, if Open Interest is showing a value of $1B, it means that there is $1B worth of long and $1B worth of short contracts currently open/unsettled in a given market. 
OI increasing = new long and short contracts are entering the market 
OI decreasing = long and short contracts are exiting the market 
OI unchanged = the net amount of positions remains the same (no new entries/exits or just a transfer of contracts occurring) 
 About this indicator  
*This script is basically a modified version of my previous "Market Sessions and Volume Profile by @LeviathanCapital" indicator but this time, profiles are generated from Tradingview Open Interest data instead of volume (+ some other changes). 
The usual representation of OI shows Open Interest value and its change based on time (for a particular day, time frame or each given candle). This indicator takes the data and plots it in a way where you can see the OI activity (change in OI) based on price levels. To put it simply, instead of observing WHEN (time) positions are entering/exiting the market, you can now see WHERE (price) positions are entering/exiting the market. This is the same concept as when it comes to Volume and Volume profile and therefore, similar strategies and ways of understanding the given data can be applied here. You can even combine the two to gain an edge (eg. high OI increase + Volume Profile showing dominant market selling = possible aggressive shorts taking place) 
Green nodes = OI increase 
Red nodes = OI decrease 
A cluster of large green nodes can be used for support and resistance levels (*trapped traders theory) or targets (lots of liquidations and stop losses above/below), OI Profile gaps can present an objective for the price to fill them (liquidity gaps, imbalances, inefficiencies, etc), and more. 
 Indicator settings 
1. Session/Lookback - Choose the range from where the OI Profile will be generated 
2. OI Profile Mode - Mode 1 (shows only OI increase), Mode 2 (shows both OI increase and decrease), Mode 3 (shows OI decrease on left side and OI increase on the right side). 
3. Show OI Value Area - Shows the area where most OI activity took place (useful as a range or S/R level ) 
4. Show Session Box - Shows the box around chosen sessions/lookback 
5. Show Profile - Show/hide OI Profile 
6. Show Current Session - Show/hide the ongoing session 
7. Show Session Labels - Show/hide the text labels for each session 
8. Resolution - The higher the value, the more refined a profile is, but fewer profiles are shown on the chart 
9. OI Value Area % - Choose the percentage of VA (same as in Volume Profile's VA) 
10. Smooth OI Data - Useful for assets that have very large spikes in OI over large bars, helps create better profiles 
11. OI Increase - Pick the color of OI increase nodes in the profile 
12. OI Decrease - Pick the color of OI decrease nodes in the profile 
13. Value Area Box - Pick the color of the Value Area Box 
14. Session Box Thickness - Pick the thickness of the lines surrounding the chosen sessions 
 Advice  
The indicator calculates the profile based on candles - the more candles you can show, the better profile will be formed. This means that it's best to view most sessions on timeframes like 15min or lower. The only exception is the Monthly profile, where timeframes above 15min should be used. Just take a few minutes and switch between timeframes and sessions and you will figure out the optimal settings. 
This is the first version of Open Interest Profile script so please understand that it will be improved in future updates. 
Thank you for your support. 
** Some profile generation elements are inspired by @LonesomeTheBlue's volume profile script 
Trend #4 - ATR+EMA channelOverview:
This strategy use ATR to take-profit, Red-EMA to stop-loss, Blue-EMA channel to judgment breakout.
This strategy use commission setting is 0.05%, slippage setting is 2 ticks, you can set the appropriate value size in the properties page.
What it does:
This strategy detects when a trend is emerging and buy or sell.
How it does it:
When the price breaks through the blue EMA channel, the trend is judged to be strong in the short term, strategy generates a buy or sell order.
After buying or selling,, if the price moves in the expected direction, uses ATR to determine the appropriate spread to take profit, otherwise use red EMA for stop loss.
How to use it:
Start Date and Stop Date - This parameter adjusts the time range used by the strategy.
Stoploss - This parameter adjusts the stop loss amount after each order is placed.
Blue EMA length - This parameter adjusts the length of the channel.
Blue EMA multy - This parameter adjusts the width of the top and bottom of the channel.
ATR Period - This parameter adjusts the number of candles used by the ATR.
ATR mult - This parameter adjusts the upper and lower widths of the ATR. Lowering this parameter can improve the win rate, but not necessarily the profitability.
Red EMA length - This parameter adjusts the number of candles used by the red EMA .
Long - This switch is used to turn Long position on or off.
Short - This switch is used to turn short position on or off.
Coral Trend Pullback Strategy (TradeIQ)Description: 
Strategy is taken from the TradeIQ YouTube video called "I Finally Found 80% Win Rate Trading Strategy For Crypto". 
Check out the full video for further details/clarification on strategy entry/exit conditions.
The default settings are exactly as TradeIQ described in his video. 
However I found some better results by some tweaking settings, increasing R:R ratio and by turning off confirmation indicators.
This would suggest that perhaps the current confirmation indicators are not the best options. I'm happy to try add some other optional confirmation indicators if they look to be more effective.
Recommended timeframe: 1H
Strategy incorporates the following features:
 Risk management: 
 
 Configurable X% loss per stop loss
 Configurable R:R ratio
 
 Trade entry: 
 
 Based on strategy conditions below
 
 Trade exit: 
 
 Based on strategy conditions below
 
 Backtesting: 
 
 Configurable backtesting range by date
 
 Trade drawings: 
 
 Each entry condition indicator can be turned on and off
 TP/SL boxes drawn for all trades. Can be turned on and off
 Trade exit information labels. Can be turned on and off
 NOTE: Trade drawings will only be applicable when using overlay strategies
 
 Alerting: 
 
 Alerts on LONG and SHORT trade entries
 
 Debugging: 
 
 Includes section with useful debugging techniques
 
 Strategy conditions 
 Trade entry: 
LONG
 
 C1: Coral Trend is bullish
 C2: At least 1 candle where low is above Coral Trend since last cross above Coral Trend
 C3: Pullback happens and price closes below Coral Trend
 C4: Coral Trend colour remains bullish for duration of pullback
 C5: After valid pullback, price then closes above Coral Trend
 C6: Optional confirmation indicators (choose either C6.1 or C6.2 or NONE):
 C6.1: ADX and DI (Single indicator)
 C6.1.1: Green line is above red line
 C6.1.2: Blue line > 20
 C6.1.3: Blue trending up over last 1 candle
 C6.2: Absolute Strengeh Histogram + HawkEye Volume Indicator (Two indicators combined)
 C6.2.1: Absolute Strengeh Histogram colour is blue
 C6.2.2: HawkEye Volume Indicator colour is green
 
SHORT
 
 C1: Coral Trend is bearish
 C2: At least 1 candle where high is below Coral Trend since last cross below Coral Trend
 C3: Pullback happens and price closes above Coral Trend
 C4: Coral Trend colour remains bearish for duration of pullback
 C5: After valid pullback, price then closes below Coral Trend
 C6: Optional confirmation indicators (choose either C6.1 or C6.2 or NONE):
 C6.1: ADX and DI (Single indicator)
 C6.1.1: Red line is above green line
 C6.1.2: Blue line > 20
 C6.1.3: Blue trending up over last 1 candle
 C6.2: Absolute Strengeh Histogram + HawkEye Volume Indicator (Two indicators combined)
 C6.2.1: Absolute Strengeh Histogram colour is red
 C6.2.2: HawkEye Volume Indicator colour is red
 
 NOTE:  All the optional confirmation indicators cannot be overlayed with Coral Trend so feel free to add each separately to the chart for visual purposes
 Trade exit: 
 
 Stop Loss: Calculated by recent swing low over previous X candles (configurable with "Local High/Low Lookback")
 Take Profit: Calculated from R:R multiplier * Stop Loss size
 
 Credits 
Strategy origin: TradeIQ's YouTube video called "I Finally Found 80% Win Rate Trading Strategy For Crypto"
It combines the following indicators for trade entry conditions:
 
 Coral Trend Indicator       by @LazyBear (Main indicator)
 Absolute Strength Histogram | jh     by @jiehonglim (Optional confirmation indicator)
 Indicator: HawkEye Volume Indicator  by @LazyBear (Optional confirmation indicator)
 ADX and DI                           by @BeikabuOyaji (Optional confirmation indicator)
SSL + Wave Trend StrategyStrategy incorporates the following features:
 Risk management: 
 
 Configurable X% loss per stop loss
 Configurable R:R ratio
 
 Trade entry: 
 
 Based on strategy conditions below
 
 Trade exit: 
 
 Based on strategy conditions below
 
 Backtesting: 
 
 Configurable backtesting range by date
 
 Trade drawings: 
 
 Each entry condition indicator can be turned on and off
 TP/SL boxes drawn for all trades. Can be turned on and off
 Trade exit information labels. Can be turned on and off
 NOTE: Trade drawings will only be applicable when using overlay strategies
 
 Alerting: 
 
 Alerts on LONG and SHORT trade entries
 
 Debugging: 
 
 Includes section with useful debugging techniques
 
 Strategy conditions 
 Trade entry: 
LONG
 
 C1: SSL Hybrid baseline is BLUE
 C2: SSL Channel crosses up (green above red)
 C3: Wave Trend crosses up (represented by pink candle body)
 C4: Entry candle height is not greater than configured threshold
 C5: Entry candle is inside Keltner Channel (wicks or body depending on configuration)
 C6: Take Profit target does not touch EMA (represents resistance)
 
SHORT
 
 C1: SSL Hybrid baseline is RED
 C2: SSL Channel crosses down (red above green)
 C3: Wave Trend crosses down (represented by orange candle body)
 C4: Entry candle height is not greater than configured threshold
 C5: Entry candle is inside Keltner Channel (wicks or body depending on configuration)
 C6: Take Profit target does not touch EMA (represents support)
 
 Trade exit: 
 
 Stop Loss: Size configurable with NNFX ATR multiplier
 Take Profit: Calculated from Stop Loss using R:R ratio
 
 Credits 
Strategy is based on the YouTube video "This Unique Strategy Made 47% Profit in 2.5 Months  " by TradeSmart.
It combines the following indicators to determine trade entry/exit conditions:
 
 Wave Trend:               Indicator: WaveTrend Oscillator   by @LazyBear
 SSL Channel:              SSL channel by @ErwinBeckers
 SSL Hybrid:               SSL Hybrid by @Mihkel00
 Keltner Channels:         Keltner Channels Bands by @ceyhun
 Candle Height:            Candle Height in Percentage - Columns by @FreeReveller
 NNFX ATR:                 NNFX ATR by @sueun123
 
Take Profit On Trend v2 (by BHD_Trade_Bot)The purpose of strategy is to detect  long-term uptrend  and  short-term downtrend  so that you can easy to take profit.
The strategy also using  BHD unit  to detect how big you win and lose, so that you can use this strategy for all coins without worry about it have different percentage of price change.
 ENTRY 
The buy order is placed on assets that have long-term uptrend and short-term downtrend:
- Long-term uptrend condition: ema200 is going up
- Short-term downtrend condition: 2 last candles are down price (use candlestick for less delay)
 CLOSE 
The sell order is placed when take profit or stop loss:
- Take profit: price increase 2  BHD unit 
- Stop loss: price decrease 3  BHD unit 
The strategy use $1000 for initial capital and trading fee is 0.1% for each order.
 Pro tip:  The 1-hour time frame for ETH/USDT has the best results on average.
CHN BUY SELLCHN BUY SELL  is formed from two RSI indicators, those are  RSI 14 and RSI 7 . I use RSI 14 to determine the trend and RSI 7 to find entry points.
 + Long (BUY) Signal: 
- RSI 14 will give a "BUY" signal, then RSI 7 will give entry point to LONG when the candle turns yellow.
 + Short (SELL) Signal: 
- RSI 14 will give a "EXIT" signal, then RSI 7 will give entry point to SHORT when the candle turns purple.
 + About Take Profit and Stop Loss: 
- With Gold, I usually set Stop Loss and Take Profit at 50 pips
- With currency pairs, I usually keep my Stop Loss and Take Profit at 30 pips
- With crypto, I usually keep Stop Loss and Take Profit at 1.5%
Recommended to use in  time frame M15 and above .
This method can be  used to trade Forex, Gold and Crypto. 
My idea is formed on the view that when the price is moving strongly, the RSI 14 will tell us what the current trend is through a "BUY" or "EXIT" signal. When RSI 14 reaches the oversold area it will form a "BUY" signal and when it reaches the overbought area it will give an "EXIT" signal. I believe that when the price reaches the oversold or overbought area, the price momentum has also decreased and is about to reverse.
After receiving a signal from RSI 14, my job is to wait for an Entry signal from RSI 7. When RSI 7 reaches the overbought area, a yellow candle will appear and that's when we enter a LONG order. When the RSI 7 reaches the oversold area, a purple candle will appear and that's when we enter a SHORT order.






















